import { Component, OnInit, HostListener, Input, Directive } from '@angular/core';

@Component({
  selector: 'app-home',
  templateUrl: './home.component.html',
  styleUrls: ['./home.component.css']
})
export class HomeComponent implements OnInit {
  public showIpList: boolean = false
  public showIpList2: boolean = false
  public ipList = [{
    ipId: 1,
    ipName: 'IP地址1'
  }, {
    ipId: 1,
    ipName: 'IP地址2'
  }, {
    ipId: 1,
    ipName: 'IP地址3'
  }, {
    ipId: 1,
    ipName: 'IP地址4'
  }, {
    ipId: 1,
    ipName: 'IP地址5'
  }, {
    ipId: 1,
    ipName: 'IP地址6'
  }, {
    ipId: 1,
    ipName: 'IP地址7'
  }]
  constructor() { }

  ngOnInit(): void {
  }
  openIpList() {
    this.showIpList = true
  }

  openIpList2() {
    this.showIpList2 = true
  }

  @HostListener('mouseleave') leaveIpBox() {
    this.showIpList = false
    this.showIpList2 = false
  }
}
